-- GENERATED SPELL FOR [Sundered Ghost] --


function spell0_24039(pUnit, Event) --@Cripple,n/a--
pUnit:FullCastSpellOnTarget(11443,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_24039', 18000, 1)
end

function spell1_24039(pUnit, Event) --@Shadow Bolt,n/a--
pUnit:FullCastSpellOnTarget(20816,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_24039', 3000, 1)
end

function Sorts_24039(pUnit, Event)
local choix_sorts_24039 = math.random(0, 1)
if choix_sorts_24039 == 0 then
pUnit:RegisterEvent('spell0_24039', 1, 1)
end
if choix_sorts_24039 == 1 then
pUnit:RegisterEvent('spell1_24039', 1, 1)
end
end

function mob24039_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_24039', math.random(1500, 3000), 1)
end

function mob24039_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob24039_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob24039_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(24039, 1, 'mob24039_Action')
RegisterUnitEvent(24039, 2, 'mob24039_Leave')
RegisterUnitEvent(24039, 3, 'mob24039_Kill')
RegisterUnitEvent(24039, 4, 'mob24039_Die')
